﻿<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ include file="/inc.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
		<meta name="viewport"
			content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>闪耀先生系列 - 填写信息</title>
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<!-- Bootstrap -->
		<link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="<%=basePath%>css/font-awesome.min.css" />
		<!-- style -->
		<link href="<%=basePath%>css/home.css" rel="stylesheet" />
	</head>
	<body>
		<div class="alert alert-danger" role="alert" id="error"
			style="display: none">
			<i class="fa fa-exclamation-triangle"></i>22
		</div>
		<form class="form-horizontal" id="form"
			action="<%=basePath%>public/stlyeAction!go.action" method="post"
			encType="multipart/form-data">
			<s:hidden name="stlye_id"></s:hidden>
			<s:hidden name="btn_id"></s:hidden>
			<s:hidden name="sign"></s:hidden>
			<s:hidden name="cloth_id"></s:hidden>
			<s:hidden name="images1"></s:hidden>
			<s:hidden name="images2"></s:hidden>
			<div class="container-fluid">
				<div class="wrap graybg">
					<s:if test='error != null'>
						<div class="error">
							<div class="alert alert-danger" role="alert">
								<i class="fa fa-exclamation-triangle"></i>
								<s:property value="error" />
							</div>
						</div>
						<!--E .error-->
					</s:if>
					<div class="photo">
						<h3>
							添加照片
						</h3>
						<div id="photo1">
							<div class="block bg1">
								<a href="##" data-toggle="modal" data-target="#myModal1"
									id="photo1">
									<div class="imgbox" id="imgbox1">
										<s:if test="images1!=null && images1!=''">
											<i class="fa fa-times-circle closed"></i>
											<img
												src="<%=basePath%>userimages/<s:property value="images1" />"
												alt="" />
										</s:if>
									</div> </a>
							</div>
						</div>
						<div id="photo2">
							<div class="block bg2">
								<a href="##" data-toggle="modal" data-target="#myModal2"
									id="photo2">
									<div class="imgbox" id="imgbox2">
										<s:if test="images2!=null && images2!=''">
											<i class="fa fa-times-circle closed"></i>
											<img
												src="<%=basePath%>userimages/<s:property value="images2" />"
												alt="" />
										</s:if>
									</div> </a>
							</div>
						</div>
					</div>
					<!--E .photo-->

					<!-- 弹窗 -->
					<div class="modal fade" id="myModal1" tabindex="-1" role="dialog"
						aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog">
							<div class="modal-content">
							
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal">
										<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
									</button></div>
									<div class="modal-body">
										<input id="fileupload" type="file" name="file1"  class="btn btn-default btn-block btn-lg" style="padding-left:15px;" />
									</div>
								
								<div class="modal-footer">
									<button type="button" onclick="go('1')" class="btn btn-primary btn-block btn-lg">
										上传照片
									</button>
									<button type="button" class="btn btn-no btn-block btn-lg" style="margin-top:20px;"
										data-dismiss="modal">
										取消
									</button>
								</div>
								
								
								
							</div>
						</div>
					</div>

					<!-- 弹窗 -->
					<div class="modal fade" id="myModal2" tabindex="-1" role="dialog"
						aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog">
							<div class="modal-content">
							
							<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal">
										<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
									</button>
</div>
									<div class="modal-body">
										<input id="fileupload" type="file" name="file2"  class="btn btn-default btn-lg btn-block" style="padding-left:15px;" />

									</div>
								
								<div class="modal-footer">
									<button type="button" onclick="go('2')" class="btn btn-primary btn-block btn-lg">
										上传照片
									</button>
									<button type="button" class="btn btn-no btn-block btn-lg" style="margin-top:20px;"
										data-dismiss="modal">
										取消
									</button>
								</div>
								
								
							</div>
						</div>
					</div>

					<div class="clearfix"></div>
					<div class="choose">
						<div class="row">
							<div class="col-xs-4">
								<s:select id="height" cssClass="form-control" name="height"
									list="#{'身高':'身高','<158CM':'<158CM','158CM':'158CM','159CM':'159CM','160CM':'160CM','161CM':'161CM','162CM':'162CM','163CM':'163CM','164CM':'164CM','165CM':'165CM','166CM':'166CM','167CM':'167CM','168CM':'168CM','169CM':'169CM','170CM':'170CM','171CM':'171CM','172CM':'172CM','173CM':'173CM','174CM':'174CM','175CM':'175CM','176CM':'176CM','177CM':'177CM','178CM':'178CM','179CM':'179CM','180CM':'180CM','181CM':'181CM','182CM':'182CM','183CM':'183CM','184CM':'184CM','185CM':'185CM','186CM':'186CM','187CM':'187CM','188CM':'188CM','189CM':'189CM','190CM':'190CM','191CM':'191CM','192CM':'192CM','193CM':'193CM','194CM':'194CM','195CM':'195CM','196CM':'196CM','197CM':'197CM','198CM':'198CM','199CM':'199CM','200CM':'200CM'}"
									listKey="key" listValue="value" value="height" />
							</div>
							<div class="col-xs-4">
								<s:select id="weight" cssClass="form-control" name="weight"
									list="#{'体重':'体重','<50KG':'<50KG','50KG':'50KG','51KG':'51KG','52KG':'52KG','53KG':'53KG','54KG':'54KG','55KG':'55KG','56KG':'56KG','57KG':'57KG','58KG':'58KG','59KG':'59KG','60KG':'60KG','61KG':'60KG','62KG':'62KG','63KG':'63KG','64KG':'64KG','65KG':'65KG','66KG':'66KG','67KG':'67KG','68KG':'68KG','69KG':'69KG','70KG':'70KG','71KG':'71KG','72KG':'72KG','73KG':'73KG','74KG':'74KG','75KG':'75KG','76KG':'76KG','77KG':'77KG','78KG':'78KG','79KG':'79KG','80KG':'80KG','81KG':'81KG','82KG':'82KG','83KG':'83KG','84KG':'84KG','85KG':'85KG','86KG':'86KG','87KG':'87KG','88KG':'88KG','89KG':'89KG','90KG':'90KG','91KG':'91KG','92KG':'92KG','93KG':'93KG','94KG':'94KG','95KG':'95KG','96KG':'96KG','97KG':'97KG','98KG':'98KG','99KG':'99KG','100KG':'100KG','100KG+':'100KG+'}"
									listKey="key" listValue="value" value="weight" />
							</div>
							<div class="col-xs-4">

								<s:select id="size" cssClass="form-control" name="size"
									list="#{
								'常穿型号':'常穿型号',
								'XZ':'--衬衫--',
								'XZ38':'38',
								'XZ39':'39',
								'XZ40':'40',
								'XZ41':'41',
								'XZ42':'42',
								'XZ43':'43',
								'XZ44':'44',
								'XZ45':'45',
								'XZ46':'46',
								'CS':'--西装--',
								'CS44':'44',
								'CS46':'46',
								'CS48':'48',
								'CS50':'50',
								'CS52':'52',
								'CS54':'54',
								'CS56':'56',
								'CS58':'58'}"
									listKey="key" listValue="value" value="size" />

							</div>
						</div>
						<div class="check-box">
							<label class="checkbox-inline">
								<s:checkbox id="call" name="call" value="call" />
								预付${bookPrice }，在微信确认后正式下单
							</label>
							<!-- <label class="checkbox-inline">
								<s:checkbox id="trade_in" name="trade_in" value="trade_in" />
								微信沟通
							</label>-->
						</div>
						<!--E .check-box-->
					</div>
					<!--E .choose-->
					<div class="style">
						<h4>
							选择款式
						</h4>
						<div class="row" id="style_div">
							<s:iterator value="page.elements" status="stat">
								<div class="col-xs-4">
									<a href="javascript:void(0);"
										onclick="selected_style('<s:property value="id" />')"><img src="<%=basePath_org%><s:property value="img" />" alt="" />
									</a>
								</div>
								<!--选中状态在-->
							</s:iterator>
						</div>
					</div>
					<!--E .style-->
					<div class="style">
						<h4>
							选择纽扣
						</h4>
						<div class="row" id="button_div">
							<s:iterator value="page2.elements" status="stat">
								<div class="col-xs-3">
									<a href="javascript:void(0);"
										onclick="selected_btn('<s:property value="id" />')"><img  src="<%=basePath_org%><s:property value="img" />" alt="" />
									</a>
								</div>
								<!--选中状态在-->
							</s:iterator>
						</div>
					</div>
					<!--E .style-->
<p>&nbsp;</p><p>&nbsp;</p>
        <p class="ptext pwithe">统一定价 / 价格最优惠</p>
        <p class="ptext">大数据匹配 / 无需量体</p>
        <p class="ptext pwithe">高定标准 / 精湛工艺</p>
        <p class="ptext ppadding-b">一对一服务 / 全程保障</p>
					<button type="button" onclick="go('3')"
						class="btn btn-org btn-lg btn-block navbar-fixed-bottom">
						马上定制
					</button>
				</div>
				<!--E .wrap-->

			</div>
		</form>



		<script src="<%=basePath%>js/jquery-1.10.1.min.js"></script>
		<script src="<%=basePath%>js/bootstrap.min.js"></script>
		<script src="<%=basePath%>js/detail.js"></script>
		<script type="text/javascript">
      $('#myModal,myModal1').modal(options)
    </script>
		<script>
function checkForm(){
	var len_imgbox1 = $('#imgbox1').find('img').length;
	if(len_imgbox1 > 0){
	
	}else{
		$('#error').css("display","none");
		$('#error').text("请选择正面照片!");
		$('#error').css("display","block");
        //return false;
	}
	
	var len_imgbox2 = $('#imgbox2').find('img').length;
	if(len_imgbox2 > 0){
	
	}else{
		$('#error').css("display","none");
		$('#error').text("请选择背面照片!");
		$('#error').css("display","block");
       // return false;
	}
	
	if($("#height").val() != "身高"){
		
	}else{
		$('#error').css("display","none");
		$('#error').text("请选择身高!");
		$('#error').css("display","block");
		 return false;
	}
	
	if($("#weight").val() != "体重"){
		
	}else{
		$('#error').css("display","none");
		$('#error').text("请选择体重!");
		$('#error').css("display","block");
		 return false;
	}
	
	if($("#size").val() != "常穿型号" && $("#size").val() != "CS" && $("#size").val() != "XZ"){
		
	}else{
		$('#error').css("display","none");
		$('#error').text("请选择常穿型号!");
		$('#error').css("display","block");
		 return false;
	}
	
	  var selFlag = false;
	  $("input[type='checkbox']").each(function(){
	  	var sel = $(this).attr("name");
	  	if(document.getElementById(sel).checked == true){
	  		selFlag = true;
	  	}
     });
     if(selFlag){
     
     }else{
		$('#error').css("display","none");
		$('#error').text("预付500为必填!");
		$('#error').css("display","block");
		 return false;
     }
     
	var style_div = $('#style_div').find("a[class='active']").length;
	if(style_div > 0){
	
	}else{
		$('#error').css("display","none");
		$('#error').text("请选择款式!");
		$('#error').css("display","block");
         return false;
	}
	
	var button_div = $('#button_div').find("a[class='active']").length;
	if(button_div > 0){
	
	}else{
		$('#error').css("display","none");
		$('#error').text("请选择纽扣!");
		$('#error').css("display","block");
         return false;
	}
	return true;
}

function go(sign) {		
	   	$('#sign').val(sign);
		if(sign == '3'){
			if(checkForm()){
				$('#form').submit();
			}else{
				var t = $('#error').offset().top;
     					$(window).scrollTop(t);
			}
		}else{
			$('#form').submit();
		}	
		
}



function selected_style(value) {
	   	$('#stlye_id').val(value);
}

function selected_btn(value) {
	   	$('#btn_id').val(value);
}
function _wxCall() {
	var sel = $(this).attr("id");
	if(document.getElementById(sel).checked == true){
		alert("选中微信");		
 		window.location.href ="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6e3f16241d2c490d&redirect_uri=http://www.shinner.cn/root/public/orderAction!userAuthView.action&response_type=code&scope=snsapi_userinfo&state=userAuth#wechat_redirect";
	}else{
		alert("no选中微信");
	}
	   
}
$(document).ready(function() {
		//$("#trade_in").bind("click",_wxCall);
		$("#call").click();
		$("#style_div div a").first().click();
		$("#button_div div a").first().click();
});
</script>


	</body>
</html>